
/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');

window.Vue = require('vue');
window.VueRouter = require("vue-router");
/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

Vue.component('my-nav', require('./components/nav.vue'));
var view = Vue.component('my-view',require("./components/view.vue"));
view.component('my-rightItem',require("./components/rightItem.vue"));
Vue.component("archives",require("./components/archives.vue"));
Vue.component("home",require("./components/home.vue"));
var article = Vue.component("my-article",require("./components/article.vue"));


const routes = [
    { path: '/', component: {template :"<home></home>"} },
    { path: '/archives/:date', component: { template: '<archives></archives>' } },
    { path: '/article/:id', component: { template: '<my-article></my-article>' } }
];

const router = new VueRouter({
    routes // （缩写）相当于 routes: routes
});

const app = new Vue({
        router
}).$mount('#app');
